package com.twu.biblioteca;

public class BibliotecaApp {

    private UserInterface userInterface;

    private MenuController menuController;

    private BookShelf bookShelf;

    public static void main(String[] args) {
        BibliotecaApp app = new BibliotecaApp();
        UserInterface userInterface1 = new UserInterface();
        app.setUserInterface(userInterface1);
        ReserveController reserveController1 = new ReserveController();
        reserveController1.setUserInterface(userInterface1);
        MenuController menuController1 = new MenuController(app);
        menuController1.setReserveController(reserveController1);
        app.setMenuController(menuController1);
        BookShelf bookShelf1 = new BookShelf();
        bookShelf1.addBook("Test-Driven Development");
        bookShelf1.addBook("REST in Practice");
        app.setBookShelf(bookShelf1);
        BookManager bookManager1 = new BookManager(bookShelf1);
        reserveController1.setBookManager(bookManager1);
        app.run();
    }

    void setUserInterface(UserInterface userInterface) {
        this.userInterface = userInterface;
    }

    public UserInterface getUserInterface() {
        return userInterface;
    }

    public void setMenuController(MenuController menuController) {
        this.menuController = menuController;
    }

    public void setBookShelf(BookShelf bookShelf) {
        this.bookShelf = bookShelf;
    }

    public BookShelf getBookShelf() {
        return bookShelf;
    }

    public void run() {
        userInterface.showWelcome();
        menuController.enter();
    }

}
